Program to Read the Excel Data
import java.sql.*;
public class Sample
{
public static void main(String args[])
{
Connection con=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:vision","scott","tiger");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(“select * from [sheet1$]”);
while(rs.next())
{
System.out.println(rs.getInt(1)+rs.getString(2)+rs.getInt(3));
}
rs.close();
st.close();
con.close();
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
catch(SQLException e)
{
e.printStackTrace();
}
finally
{
try
{
if(con!=null)
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
}
}